<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8"/>
    <title>Title</title>
	 <!-- Required meta tags -->
  <meta charset="utf-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
  <title>Purple Admin</title>
  <!-- plugins:css -->
  <link rel="stylesheet" href="../../vendors/iconfonts/mdi/css/materialdesignicons.min.css"/>
  <link rel="stylesheet" href="../../vendors/css/vendor.bundle.base.css"/>
  <!-- endinject -->
  <!-- plugin css for this page -->
  <link rel="stylesheet" href="../../node_modules/jqvmap/dist/jqvmap.min.css" />
  <!-- End plugin css for this page -->
  <!-- inject:css -->
  <link rel="stylesheet" href="../../css/style.css"/>
  <!-- endinject -->
  <link rel="shortcut icon" href="../../images/favicon.png" />
  <link rel="stylesheet" href="../../layer/mobile/need/layer.css" />


</head>
<body>
	<div class="col-lg-12 stretch-card">
              <div class="card">
                <div class="card-body">
                  <h4 class="card-title">
				  <button type="button" class="btn btn-gradient-primary btn-rounded btn-icon">
                          <i class="mdi mdi-home-outline"></i>
                        </button>
				  <font style="vertical-align: inherit;"><font style="vertical-align: inherit;">首页/财务管理/本金放款台账</font></font></h4>
				  
					<form id="MyForm" method="post" class="form-inline">
                        <input id="currentPageNo" type="hidden" name="currentPageNo" value="1" />
                        <span>借款编号:</span>
                        <input th:value="0" class="form-control" type="text" id="queryUserRole" name="queryUserRole" placeholder="借款编号"
                               style="width:130px;height:26px"/>
                        <span>借款人:</span>
                        <input type="text" class="form-control" name="queryname" id="queryname" style="width:130px;height:26px"
                               th:value="${queryname}" placeholder="借款人"/>
						<button type="button" class="btn btn-gradient-primary btn-icon-text" id="submit">
                          <i class="mdi mdi-file-check btn-icon-prepend"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
                          查询
                        </font></font></button>
							
					</form>
				  
                  <span class="card-description"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
                    数据列表 </font></font>
                  </span>
				  <div style="position:relative;left:87%;">
				  <!--<button type="button" class="btn btn-gradient-danger" id="stmBtn"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">对账确认</font></font></button>-->
                  </div>
				  <table class="table table-bordered">
                    <thead>
                      <tr>
                        <th><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
                          全选
                        </font></font></th>
                        <th><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
                          借款编号
                        </font></font></th>
                        <th><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
                          借款人
                        </font></font></th>
                        <th><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
                          期限
                        </font></font></th>
						<th><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
                          放款金额(元)
                        </font></font></th>
						<th><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
                          放款时间
                        </font></font></th>
						<th><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
                          放款方式
                        </font></font></th>
						<th><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
                          对账人员
                        </font></font></th>
						<th><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
                          对账日期
                        </font></font></th>
						<th><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
                          对账状态
                        </font></font></th>
						<th><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
                          操作
                        </font></font></th>
                      </tr>
                    </thead>
                    <tbody>
                      <tr th:attr="id=${user.userId}+'_row'" th:each="user:${queryUserList}" class="tableTr">
                        <td><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
                          <input type="checkbox" th:value="${user.userId}"/>
                            <input type="hidden" th:attr="id=${user.userId }+'_userId'" th:value="${user.userId}"/>
                        </font></font></td>
                        <td th:text="${user.borrowOrder.boId}"></td>
                        <td th:text="${user.userName}"></td>
                        <td th:text="${user.borrowOrder.oLoanTime}"></td>
                        <td th:text="${user.borrowOrder.oWantedMoney}"></td>
                        <td th:text="${user.borrowOrder.oCreateTime}"></td>
                        <td th:text="${user.loanType.lName}"></td>
                        <td th:text="${user.yVerify.verifyName}"></td>
                        <td th:text="${user.yVerify.verifyDate}"></td>
                        <!--<td th:text="${user.yVerify.verifyStatus}"></td>-->
                          <td th:if="${user.yVerify.verifyStatus eq 1}" th:text="未对账" class="sta">未对账1</td>
                          <td th:if="${user.yVerify.verifyStatus eq 2}" th:text="已对账" class="sta">已对账2</td>
                          <td th:if="${user.yVerify.verifyStatus eq 3}" th:text="异常" class="sta">异常3</td>
                          <td th:if="${user.yVerify.verifyStatus eq 4}" th:text="冲正" class="sta">冲正4</td>
						<td><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
						  <button th:onclick="'showInfo(this)'">查看详情</button>
						  <button th:onclick="'aaa(this)'">对账确认</button>
                        </font></font></td>
                      </tr>
                    </tbody>
                  </table>
                    <div class="page-bar">
                        <ul class="page-num-ul clearfix">
                            <li>共<span th:text="${page.totalCount }"></span>条记录&nbsp;&nbsp; <span th:text="${page.pageIndex}"></span>/<span th:text="${page.totalPageCount}"></span> 页</li>
                            <button th:onclick="'javascript:pageQry(document.forms[0],1)'" th:if="${page.pageIndex gt 1 }">首页</button>
                            <button th:onclick="'javascript:pageQry(document.forms[0],'+${page.pageIndex - 1}+')'"  th:if="${page.pageIndex gt 1 }">上一页</button>
                            <button th:onclick="'javascript:pageQry(document.forms[0],'+${page.pageIndex + 1}+')'" th:if="${page.pageIndex lt page.totalPageCount}">下一页</button>
                            <button th:onclick="'javascript:pageQry(document.forms[0],'+${page.totalPageCount}+')'" th:if="${page.pageIndex lt page.totalPageCount}">最后一页</button>
                        </ul>
                        <span class="page-go-form"><label>跳转至</label>
                     <input type="hidden" id="totalPageCount" th:value="${page.totalPageCount}"/>
                     <input type="text" name="inputPage" id="inputPage" class="page-key"/>页
                     <button type="button" class="page-btn"
                             th:onClick="'jumpPage(document.forms[0],document.getElementById(\''+inputPage+'\').value)'">GO</button>
                      </span>
                    </div>
                    <div id="showUserInfo" style="display: none;">
                        <table>
                            <tr>
                                <td>借款编号:</td>
                                <td id="show-username">11</td>
                            </tr>
                            <tr>
                                <td>借款人:</td>
                                <td id="show-gender">22</td>
                            </tr>
                            <tr>
                                <td>期限:</td>
                                <td id="show-birthday">33</td>
                            </tr>
                            <tr>
                                <td>放款金额（元）:</td>
                                <td id="show-address">44</td>
                            </tr>
                            <tr>
                                <td>放款日期:</td>
                                <td id="show-createDate">55</td>
                            </tr>
                            <tr>
                                <td>放款方式:</td>
                                <td id="show-modifyDate">66</td>
                            </tr>
                            <tr>
                                <td>对账人员:</td>
                                <td id="show-ry">77</td>
                            </tr>
                            <tr>
                                <td>对账日期:</td>
                                <td id="show-rq">88</td>
                            </tr>
                            <tr>
                                <td>对账状态:</td>
                                <td id="show-zt">99</td>
                            </tr>
                        </table>
                    </div>
                </div>
              </div>
            </div>
    <script type="text/javascript" th:src="@{/js/jquery-1.8.3.min.js}"></script>
    <script type="text/javascript" th:src="@{/layer/layer.js}"></script>
    <script type="text/javascript" th:src="@{/js/time.js}"></script>
    <script type="text/javascript">
        function aaa(ele) {
            alert("确认对账？");
            $(ele).parents("tr").find(".sta").html('已对账');
        }
        //01.分页查询
        function pageQry(form, pageIndex) {
            // form.currentPageNo.value = pageIndex;//赋值给【分页+条件查询的表单】
            // form.submit();//用js主动提交
            $.ajax({
                type:"post",
                url:"/ysy/principal?currentPageNo="+pageIndex+"",
                data:"page=1",
                success: function(){
                    // $("#Conframe").load("/ysy/principal?currentPageNo="+pageIndex+"");
                    window.location.href = "/ysy/principal?currentPageNo=" + pageIndex;
                },
                error:function () {
                    alert("错误");
                }
            })
        }

        //02.跳转页查询
        function jumpPage(form, jumpPageIndex) {
            //01.数字校验
            var reg = /^[1-9]\d{0,}$/;
            if (!reg.test(parseInt(jumpPageIndex))) {
                alert("请输入合法的数字");
                return;
            }
            //02.范围校验：当前页不能大于总页数
            if (jumpPageIndex > document.getElementById("totalPageCount").value) {
                alert("已经是最后一页!");
                return;
            }
            // form.currentPageNo.value = jumpPageIndex;
            // form.submit();
            $.ajax({
                type:"post",
                url:"/ysy/principal?currentPageNo="+jumpPageIndex+"",
                data:"page=1",
                success: function(){
                    // $("#Conframe").load("/ysy/principal?currentPageNo=" + jumpPageIndex + "");
                    window.location.href = "/ysy/principal?currentPageNo="+jumpPageIndex;
                },
                error:function () {
                    alert("错误");
                }
            })
        }
        //查询
        $("#submit").click(function () {
            // alert($("#MyForm").serialize());
            $.ajax({
                type: "post",
                dataType: "text",
                url: "/ysy/principal?currentPageNo=1",
                data:$("#MyForm").serialize(),
                success: function () {
                    // alert($("#MyForm").serialize());
                    // $("#Conframe").load("/ysy/principal?"+$("#MyForm").serialize()+"");
                    window.location.href = "/ysy/principal?"+$("#MyForm").serialize();
                },
                error: function () {
                    alert("异常");
                }
            });
        });
        // var data = [];
        // $('#stmBtn').click(function(){
        // $('input:checkbox').each(function() {
        //     console.log($(this).attr('checked'));
        //     console.log($(this).attr('value'));
        //     if ($(this).attr('checked') == 'checked') {
        //         data.push($(this).val());
        //     }
        //     console.log($(".tableTr").find("tr:eq(9)").html());
        // })
        // });
        //     // var userId = $("input:checkbox:checked").val();
        //     // console.log(userId);
        function showInfo(ele) {
            var $ele = $(ele);
            layer.open({
                type: 2,
                title: '查看详情',
                content: $("#showUserInfo").html() //iframe的url
            });
        }
    </script>
</body>
</html>